<?php 
$bg_imgs = scandir(PLGN_DIR . '/' . basename(dirname(__FILE__)) . '/images/__bg/');
$idx = rand() % count($bg_imgs);
$idx = max($idx, 3);
?>
<style>
.login_form_extra { background: url('<?php echo PLGN_DIR . basename(dirname(__FILE__)) . '/images/__bg/' . $bg_imgs[$idx]; ?>') repeat; }
</style>

<link rel="stylesheet" type="text/css" href="<?php echo PLGN_DIR . basename(dirname(__FILE__)); ?>/css/style.css" />

<script type="text/javascript">
$(document).ready(function() {
  $(".username").focus(function() {
    $(".user-icon").css("left","-48px");
  });
  $(".username").blur(function() {
    $(".user-icon").css("left","0px");
  });
  
  $(".password").focus(function() {
    $(".pass-icon").css("left","-48px");
  });
  $(".password").blur(function() {
    $(".pass-icon").css("left","0px");
  });
});
</script>

<div id="wrapper">

  <!--SLIDE-IN ICONS-->
    <div class="user-icon"></div>
    <div class="pass-icon"></div>
    <!--END SLIDE-IN ICONS-->

<!--LOGIN FORM-->
<form name="login-form" class="login-form login_form_extra" action="<?php echo Utils::get_requrl($app_data, '&amp;') . 'login'; ?>" method="post">
  <input type="hidden" name="url" value="<?php echo URL . HOME_DIR . $app_data->sys->php_name . ".php?i=$app_data->param_id"; ?>" />
  <input type="hidden" name="rt_url" value="<?php echo (($app_data->param_url) ? urlencode($app_data->param_url) : ''); ?>" />

  <!--HEADER-->
    <div class="header">
    <!--TITLE--><img src="<?php echo PLGN_DIR . basename(dirname(__FILE__)); ?>/images/logo.png" alt="" style="width: 100%;"></img><!--END TITLE-->
    <!--DESCRIPTION--><span>Fill out the form below to login to control panel.</span><!--END DESCRIPTION-->
    </div>
    <!--END HEADER-->
  
  <!--CONTENT-->
    <div class="content">
  <!--USERNAME--><input name="user" type="text" class="input username" value="Username" onfocus="this.value=''" /><!--END USERNAME-->
    <!--PASSWORD--><input name="pass" type="password" class="input password" value="Password" onfocus="this.value=''" /><!--END PASSWORD-->
    </div>
    <!--END CONTENT-->
    
    <!--FOOTER-->
    <div class="footer">
    <!--LOGIN BUTTON--><input type="submit" name="submit" value="Login" class="button" /><!--END LOGIN BUTTON-->
    <?php if (isset($_SESSION['lgnerr'])) { ?>
    <p class="clearfix"><p class="err"><?php echo $_SESSION['lgnerr']; ?></p></p>
    <?php } ?>
    </div>
    <!--END FOOTER-->

</form>
<!--END LOGIN FORM-->

</div>

